﻿using System;
using System.ComponentModel;

namespace Fuse8.ContentManagementFramework.Domain.Special
{
    public enum CmsTemplateTypeKind
    {
        [Description("Please select")]
        NotDefined = 0,

        [Description("aspx master page")]
        WebForm = 1,

        [Description("mvc master page")]
        MvcForm = 2,

        [Description("mvc razor")]
        MvcRazor = 3
    }

    public static class CmsTemplateTypeKindExtensions
    {
        public static CmsPageTypeKind Convert(this CmsTemplateTypeKind type)
        {
            CmsPageTypeKind result = CmsPageTypeKind.NotDefined;

            switch (type)
            { 
                case CmsTemplateTypeKind.WebForm:
                    result = CmsPageTypeKind.AspNetForm;
                    break;
                case CmsTemplateTypeKind.MvcForm:
                case CmsTemplateTypeKind.MvcRazor:
                    result = CmsPageTypeKind.AspNetMvc;
                    break;
            }

            return result;
        }
    }
}
